﻿using System;
using System.Linq;

namespace MST_17_01_add_without_plus_lcci
{
    class Program
    {
        static void Main (string[] args)
        {
            Console.WriteLine (new Solution().Add(1,1));
            Console.WriteLine (new Solution().Add(3,4));
            Console.WriteLine (new Solution().Add(5,6));
        }
    }

    public class Solution
    {
        public int Add (int a, int b)
        {
            //while (a != 0)
            //{
            //    int tmp = a;
            //    a = (a & b) << 1;
            //    b = tmp ^ b;
            //}
            //return b;
            int[] sum = new int[] { a, b };
            return sum.Sum();
        }
    }
}
